<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->link($this->__('system.button.back'), $this->historyUrl('*/*/*/index')));
echo $t->renderEnd();

$this->nextBlock('form');
$f = $this->form()->setId('form')->setAction($this->buildUrl('*/*/*/save'));
if($this->model):
	$f->setData($this->model->getAllData());
endif;

echo $f->renderBegin();
echo $f->createField($this->__('system.label.component_id'), TRUE)
       ->setInput($this->select('component_id', 'model[component_id]')
                       ->setLabelFormat('<{lang "%s"}>')
                       ->bindData($this->components, 'name', 'id'));
echo $f->createField($this->__('system.label.class_name'), TRUE)
       ->setInput($this->textbox('class_name', 'model[class_name]')->addCharacterRule());
echo $f->createField($this->__('system.label.table_name'), TRUE)
       ->setInput($this->textbox('entity_table_name', 'model[entity_table_name]')->addCharacterRule());
echo $f->createField($this->__('system.label.is_version'), TRUE)
       ->setInput($this->selectBoolean('table_name', 'model[is_version]'));
echo $f->createField($this->__('system.label.create_file'), TRUE)
       ->setInput($this->selectBoolean('is_create_file', 'model[is_create_file]'));
echo $f->createField($this->__('system.label.create_table'), TRUE)
       ->setInput($this->selectBoolean('is_create_table', 'model[is_create_table]'));
echo $f->createField($this->__('system.label.creator'), TRUE)
       ->setInput($this->selectBoolean('is_creator', 'model[is_creator]'));
echo $f->createField($this->__('system.label.updator'), TRUE)
       ->setInput($this->selectBoolean('is_updator', 'model[is_updator]'));
echo $f->createField($this->__('system.label.created_time'), TRUE)
       ->setInput($this->selectBoolean('is_created_time', 'model[is_created_time]'));
echo $f->createField($this->__('system.label.updated_time'), TRUE)
       ->setInput($this->selectBoolean('is_updated_time', 'model[is_updated_time]'));
echo $f->bind($this->hidden('id', 'model[id]'));
echo $f->renderEnd();

$t2 = $this->toolbar();
echo $t2->renderBegin();
echo $t2->renderItem($this->linkButton($this->__('system.button.submit'), "submitForm('form')"));
echo $t2->renderEnd();
$this->endBlock();
echo $this->extend('template'.DS.'form');